/**
 * 解决node内存大小的问题
 * MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 upgrade listeners
 */
require('events').EventEmitter.defaultMaxListeners = 0
module.exports = {
    css: {
        loaderOptions: {
            less: {
                javascriptEnabled: true,
            },
        },
    },
    pluginOptions: {
        electronBuilder: {
            preload: 'src/preload.js',
            nodeIntegration: true,
        },
    },
    devServer: {
        port: 8080,
        proxy: {
            //配置跨域
            '/videoUrl': {
                target: 'https://www.1905.com/search/',
                changOrigin: true, //允许跨域
                pathRewrite: {
                    '^/videoUrl': '',
                },
            },
            '/videoDetail': {
                target: 'https://www.1905.com/mdb/film/',
                changOrigin: true,
                pathRewrite: {
                    '^/videoDetail': '',
                },
            },
            '/mdb': {
                target: 'http://image11.m1905.cn/mdb/uploadfile/',
                changOrigin: true,
                pathRewrite: {
                    '^/mdb': '',
                },
            },
            '/coverImage1': {
                target: 'https://image11.m1905.cn/uploadfile/',
                changOrigin: true,
                pathRewrite: {
                    '^/coverImage1': '',
                },
            },
            '/play': {
                target: 'http://localhost:3667/play',
                changOrigin: true,
                pathRewrite: {
                    '^/play': '',
                },
            },
            '/socket.io': {
                target: 'http://localhost:3667',
                changOrigin: true,
                ws: true,
            },
        },
    },
}
